<style type="text/css">
.editclass a  {
	padding-left:20px;
	text-decoration: YES;
    color: blue;
}
</style>
<div class="middle">
  <div style="width: 735px; margin-bottom: 30px; border: 1px solid #77b7ff;background: #FFFFFF none repeat scroll 0 0;moz-border-radius: 1em 1em 1em 1em;-webkit-border-radius: 1em 1em 1em 1em;border-radius: 1em 1em 1em 1em;">
    <table style="width: 690px; height:300px;">
      <tr>
       	<td colspan="2" style="border:1px soild;color: #2b4d9a;" >
			<div class="one_tab" style="color:#2b4d9a;"><?php echo $heading_title; ?></div>
       	</td>
      </tr>
      <tr>
        <td style="text-align: center; vertical-align: top; width:200px;padding: 20px">
        <a href="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" class="thickbox">

        <!---Feb 24 2012 Nhan bo phan nay
        <td style="text-align: center; vertical-align: top; width:200px;padding: 20px;border: 1px solid #DDDDDD">
        	<a href="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" class="thickbox">
        		<img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" id="image" style="margin-bottom: 3px;" />
        	</a>
        	<br />
          <span style="font-size: 11px;"><?php echo $text_enlarge; ?></span>
        </td>
        	   End -->

       <!-- start Mr Nhan Feb 22 2012 -- edit image error => image defult -->
        <!-- image error -->
        <!-- <img onerror="this.className='matdinh'" src="<?php echo $thumb ?>" title="<?php echo $heading_title; ?>" id="image" style="margin-bottom: 3px;" /> -->
        <img onerror="this.className='matdinh'" width="250px" src="<?php if(isset($thumb)){echo $thumb;}else{echo $src='image/logo/logo-new.jpg';} ?>" title="<?php echo $heading_title; ?>" id="image" style="margin-bottom: 3px;" />
        <!-- end -->
        	</a>
       	<br />

          <span style="font-size: 11px;"><?php echo $text_enlarge; ?></span>
        </td>
        <td style="padding: 15px; width: 296px; vertical-align: top;color:#0b2044;"><table width="100%">
            <?php if ($display_price) { ?>
            <tr>
              <td style="width: 150px;padding-bottom: 5px;" ><b><?php echo $text_price; ?></b></td>
              <td style="font-size:14px;font-weight:bold;color:blue;"><?php if (!$special) { ?>
                <?php echo $price; ?>
                <?php } else { ?>
                <span style="text-decoration: line-through;"><?php echo $price; ?></span> <span style="color: #F00;"><?php echo $special; ?></span>
                <?php } ?></td>
            </tr>
            <?php } ?>
            <tr>
              <td style="width: 150px;padding-bottom: 5px;" ><b><?php echo $text_availability; ?></b></td>
              <td><?php echo $stock; ?></td>
            </tr>
            <tr>
              <td style="width: 150px;padding-bottom: 5px;"><b><?php echo $text_add_date; ?></b></td>
              <td><?php echo $add_date; ?></td>
            </tr>
            <tr>
              <td style="width: 150px;padding-bottom: 5px;"><b><?php echo $text_username; ?></b></td>
              <td><?php echo $username; ?></td>
            </tr>
              <tr>
              <td style="width: 150px;padding-bottom: 5px;"><b><?php echo $text_zone; ?></b></td>
              <td><?php echo $zone; ?></td>
            </tr>
			<tr>
              <td style="width: 150px;padding-bottom: 5px;"><b><?php echo $text_view; ?></b></td>
              <td><?php echo $number_view ; ?></td>
            </tr>

            <tr>
              <td style="width: 150px;padding-bottom: 5px;"><b><?php echo $text_average; ?></b></td>
              <td>
			  <!--Add code by D-Ngan Aug 26 2012-->
			  <!--Add code by Q-Hieu Oct 17 2012-->
				  	<?php 
					if($this->customer->isLogged()){
						$src_imag='catalog/view/theme/default/image/star';
						if($average){
							$i_rate=round($average);
						?>
							<img onMouseOver="show_hide(1);" onMouseout="show_hide(0);" onClick="set_rate(1);" id="star_1" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="1 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(2);" onMouseout="show_hide(0);" onClick="set_rate(2);" id="star_2" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="2 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(3);" onMouseout="show_hide(0);" onClick="set_rate(3);" id="star_3" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="3 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(4);" onMouseout="show_hide(0);" onClick="set_rate(4);" id="star_4" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="4 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(5);" onMouseout="show_hide(0);" onClick="set_rate(5);" id="star_5" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="5 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
						
						<?php
						}
						else{
							$i_rate=0;
						?>
							<img onMouseOver="show_hide(1);" onMouseout="show_hide(0);" onClick="set_rate(1);" id="star_1" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="1 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(2);" onMouseout="show_hide(0);" onClick="set_rate(2);" id="star_2" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="2 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(3);" onMouseout="show_hide(0);" onClick="set_rate(3);" id="star_3" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="3 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(4);" onMouseout="show_hide(0);" onClick="set_rate(4);" id="star_4" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="4 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(5);" onMouseout="show_hide(0);" onClick="set_rate(5);" id="star_5" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="5 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
								
						<?php
						}
					}else{
						$src_imag='catalog/view/theme/default/image/star';
						if($average){
							$i_rate=round($average);
						?>
							<img onMouseOver="show_hide(1);" onMouseout="show_hide(0);"  onClick="require_login();" id="star_1" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="1 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(2);" onMouseout="show_hide(0);"  onClick="require_login();" id="star_2" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="2 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(3);" onMouseout="show_hide(0);"  onClick="require_login();" id="star_3" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="3 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(4);" onMouseout="show_hide(0);"  onClick="require_login();" id="star_4" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="4 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(5);" onMouseout="show_hide(0);"  onClick="require_login();" id="star_5" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="5 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
						
						<?php
						}
						else{
							$i_rate=0;
						?>
							<img onMouseOver="show_hide(1);" onMouseout="show_hide(0);"  onClick="require_login();" id="star_1" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="1 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(2);" onMouseout="show_hide(0);"  onClick="require_login();" id="star_2" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="2 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(3);" onMouseout="show_hide(0);"  onClick="require_login();" id="star_3" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="3 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(4);" onMouseout="show_hide(0);"  onClick="require_login();" id="star_4" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="4 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
							<img onMouseOver="show_hide(5);" onMouseout="show_hide(0);"  onClick="require_login();" id="star_5" height="20" src="<?php if($i_rate>0){ echo $src_imag; $i_rate--;} else {echo $src_imag.'_white';}?>.png" alt="5 sao" title="<?php echo round($average,2)?>/5 điểm với <?php echo $sumvote?> lượt đánh giá.">
								
						<?php
						}
					}
                  	?>
     			<!--End add Code by D-NGan 2012-->
				</td>

            </tr>
          </table>
          <br />
		  
          <?php if ($display_price) { ?>
          <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" name="product" id="product" >
            <?php if ($options) { ?>
            <b><?php echo $text_options; ?></b><br />
            <div style="background: #FBFAEA; border: 1px solid #EFEBAA; padding: 10px; margin-top: 2px; margin-bottom: 15px;">
              <table style="width: 100%;">
                <?php foreach ($options as $option) { ?>
                <tr>
                  <td><?php echo $option['name']; ?>:</td>
                  <td><select name="option[<?php echo $option['option_id']; ?>]">
                      <?php foreach ($option['option_value'] as $option_value) { ?>
                      <option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?>
                      <?php if ($option_value['price']) { ?>
                      <?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?>
                      <?php } ?>
                      </option>
                      <?php } ?>
                    </select></td>
                </tr>
                <?php } ?>
              </table>
              <?php } ?>
            </div>
            <?php if ($display_price) { ?>
            <?php if ($discounts) { ?>
            <b><?php echo $text_discount; ?></b><br />
            <div style="background: #F6F9FF; border: 1px solid #DDDDDD; padding: 10px; margin-top: 2px; margin-bottom: 15px;">
              <table style="width: 100%;">
                <tr>
                  <td style="text-align: right;"><b><?php echo $text_order_quantity; ?></b></td>
                  <td style="text-align: right;"><b><?php echo $text_price_per_item; ?></b></td>
                </tr>
                <?php foreach ($discounts as $discount) { ?>
                <tr>
                  <td style="text-align: right;"><?php echo $discount['quantity']; ?></td>
                  <td style="text-align: right;"><?php echo $discount['price']; ?></td>
                </tr>
                <?php } ?>
              </table>
            </div>
            <?php } ?>
            <?php } ?>
            
   <!--Jan 08 Mr Duc add cart-->
             <div style="width:300px; padding: 10px;"><?php echo $text_qty; ?>
    	        <input type="text" name="quantity" size="3" value="1" />
	            <a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a>
            </div>
<!---End-->
            <!---Jan 07 2012 Mr Duc add Cart

            <div class="cart">
           <div><?php echo $text_qty; ?>
            <input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
             <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
            &nbsp;<a id="button-cart" class="button"><span><?php echo "Mua hang"; ?></span></a></div>
             --End-->



            <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
            <input type="hidden" name="act" id="act" />
            <input type="hidden" name="old_image" id="old_image" value="<?php echo $old_image; ?>" />
          </form>
          <?php } ?></td>
      </tr>
    </table>



    <!--Jan 11 2012 Nhan  BEGIN
<div class="addthis_toolbox addthis_default_style" style="padding-left:25px">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_google"></a>
</div>
<script  type="text/javascript"  src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e344ae31e7ef1cc"></script></br>
-- AddThis Button END -->
<!--Jan 12 2012 Duc  BEGIN -->
<div class="share"><!-- AddThis Button BEGIN -->
          <div class="addthis_default_style"><a class="addthis_button_compact"><?php echo "Chia sẻ"; ?></a> <a class="addthis_button_facebook"></a> <a class="addthis_button_twitter"></a> <a class="addthis_button_email"></a><a class="addthis_button_print"></a> </div>
          <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
          <!-- AddThis Button END -->
          <a></a>
</div>
<!---- End -->
<!-- Mr Duc Apr 11 2012 Them Phan chinh sua va Xoa san pham #DFFFDD -->
    <?php if($cust_valid == "ON") { ?>
	    <div style="width: 735px; clear: both; height: 20px; background: #DFFFDD; color: #CD1076;moz-border-radius: 1em;-webkit-border-radius: 1em;border-radius: 1em;" class="editclass">
    	<a href="javascript:void(0);" onClick="editproduct();">
	        	Sửa tin
	    	</a>
	    	<a href="javascript:void(0);" onClick="confirmation();" >
	        	Xóa tin
	    	</a>
	  	</div>
  	<?php } ?>
<!--End --->
  </div>
  

	<div id = "tab" class="tabs">
		<li><a  class = "seleted" href="#tab-description"><?php echo $tab_description; ?></a></li>
		<!--Edit by Q Hieu 16/11/2012-->
		<li><a href="#tab-related"><?php echo $tab_related; ?> </a></li>
		<li><a href="#tab_review"><?php echo $tab_review; ?> </a></li>
	</div>
  
	<div id="tab-description" class="page_shop " style="display: block;"><?php echo $description; ?></div>
	<div id="tab-related" class="page_shop">
	<div id="top_header">Sản phẩm mới đăng</div>
	<div class="box_product">
		<?php foreach ($products_new as $product) { ?>
		<div>
			<div class="image"><a href="<?php echo $product['href']; ?>"><img width="140px" height="170px" src="<?php echo $product['thumb']; ?>" /></a></div>
			<div class="name" style="max-width : 170px; overflow:hidden; text-overflow: ellipsis; white-space: nowrap;">
			<a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
			<?php if ($product['price']) { ?>
				<div class="price">
					<?php if (!$product['special']) { ?>
						<?php echo $product['price']; ?>
					<?php } else { ?>
						<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
					<?php } ?>
				</div>
			<?php } ?>
			<?php if ($product['rating']) { ?>
				<div width="96px" height="18" class="rating"><img src="catalog/view/theme/default/image/stars_<?php echo round($product['rating'],0); ?>.png" title="Được đánh giá <?php echo round($product['rating'],2)?>/5 điểm" /></div>
			<?php } else { ?>
				<div width="96px" height="18" class="rating"><img src="catalog/view/theme/default/image/stars_1.png" title="Chưa được đánh giá."/></div>
			<?php } ?>
		</div>
		<?php } ?>
	</div>
	<div id="top_header">Sản phẩm được nhiều người xem</div>
	<div class="box_product">
		<?php foreach ($products_view as $product) { ?>
		<div>
			<div class="image"><a href="<?php echo $product['href']; ?>"><img width="140px" height="170px" src="<?php echo $product['thumb']; ?>" /></a></div>
			<div class="name" style="max-width : 170px; overflow:hidden; text-overflow: ellipsis; white-space: nowrap;">
			<a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
			<?php if ($product['price']) { ?>
				<div class="price">
					<?php if (!$product['special']) { ?>
						<?php echo $product['price']; ?>
					<?php } else { ?>
						<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
					<?php } ?>
				</div>
			<?php } ?>
			<?php if ($product['rating']) { ?>
				<div width="96px" height="18" class="rating"><img src="catalog/view/theme/default/image/stars_<?php echo round($product['rating'],0); ?>.png" title="Được đánh giá <?php echo round($product['rating'],2)?>/5 điểm" /></div>
			<?php } else { ?>
				<div width="96px" height="18" class="rating"><img src="catalog/view/theme/default/image/stars_1.png" title="Chưa được đánh giá."/></div>
			<?php } ?>
		</div>
		<?php } ?>
	</div>
	</div>
 <!--End by Q Hieu 16/11/2012-->
  <div id="tab_review" class="page_shop" style="moz-border-radius: 4px;-webkit-border-radius: 4px;border-radius: 4px;">
  <div id="review"></div>
  <div class="heading" id="review_title"><?php echo $text_write; ?></div>

<!--Start Edit login to comment by Le-Minh 02/06/2012-->

<?php  
   if ($this->customer->isLogged()){?>
      <div style="background: #F6F9FF; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px;moz-border-radius: 4px 4px 4px 4px;-webkit-border-radius: 4px 4px 4px 4px;border-radius: 4px 4px 4px 4px;">
      <input type="hidden" id="commnent_box" name="name" value="<?php echo $this->customer->getUserName();?>" size="40" />
      <textarea name="text" style="width: 100%;" rows="5"></textarea>
      <span style="font-size: 11px;"><?php echo $text_note; ?></span><br />
      </div>
    <div class="buttons">
       <a onclick="review();" class="button"><span>Xác nhận</span></a>
    </div>
	<?php
}
else{
 echo'<div><a href="index.php?route=account/login">Xin vui lòng đăng nhập để bình luận sản phẩm</a></div>';
}
?>
<!--End Edit login to comment by le_minh 02/06/2012-->
  </div>

</div>
<div class="bottom">&nbsp;</div>
<script type="text/javascript">

function confirmation() {
	var answer = confirm("Bạn có chắc muốn xóa sản phẩm này?")
	var frm = document.product;
	if (answer){
		frm.act.value = "delete";
		frm.action ="<?php echo $href_delete; ?>";
		frm.submit();
	}
}

function editproduct() {
	var frm = document.product;
	var flag = true;
	if (flag){
		flag = false;
		frm.act.value = "update";
		frm.action ="<?php echo $href_modify; ?>";
		frm.submit();
	}
}

$('#review .pagination a').live('click', function() {
	$('#review').slideUp('slow');

	$('#review').load(this.href);

	$('#review').slideDown('slow');

	return false;
});

$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');



function review() {
	$.ajax({
		type: 'post',
		url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
		dataType: 'json',
		data: 'name=' + encodeURIComponent($('input[name=\'name\']').val()) + '&text=' + encodeURIComponent($('textarea[name=\'text\']').val()) + '&rating=' + encodeURIComponent($('input[name=\'rating\']:checked').val() ? $('input[name=\'rating\']:checked').val() : '') + '&captcha=' + encodeURIComponent($('input[name=\'captcha\']').val()),
		beforeSend: function() {
			$('.success, .warning').remove();
			$('#review_button').attr('disabled', 'disabled');
			$('#review_title').after('<div class="wait"><img src="catalog/view/theme/default/image/loading_1.gif" alt="" /> <?php echo $text_wait; ?></div>');
		},
		complete: function() {
			$('#review_button').attr('disabled', '');
			$('.wait').remove();
		},
		success: function(data) {
			if (data.error) {
				$('#review_title').after('<div class="warning">' + data.error + '</div>');
			}

			if (data.success) {
				$('#review_title').after('<div class="success">' + data.success + '</div>');
				$('input[name=\'name\']').val('');
				$('textarea[name=\'text\']').val('');
				$('input[name=\'rating\']:checked').attr('checked', '');
				$('input[name=\'captcha\']').val('');
				$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');
				$('#captcha_value').load('index.php?route=product/product/reload_captcha');
			}
		}
	});
}
//Add code by Q-Hieu Oct 17 2012
function show_hide(value){
if(<?php echo $checkvote?> == 0){
	if(value >= <?php echo round($average)?>){
		for(i=1; i<=value; i++){
			document.getElementById('star_'+i).setAttribute('src','<?php echo 'catalog/view/theme/default/image/star_red.png';?>');
		}
		for(i=value+1;i<6;i++){
			document.getElementById('star_'+i).setAttribute('src','<?php echo $src_imag.'_white.png';?>');
		}
	} else {
		for(i=1; i<=value; i++){
			document.getElementById('star_'+i).setAttribute('src','<?php echo 'catalog/view/theme/default/image/star_red.png';?>');
		}
		for(i=value+1;i<= <?php echo round($average)?>;i++){
			document.getElementById('star_'+i).setAttribute('src','<?php echo $src_imag.'.png';?>');
		}
		for(i=<?php echo round($average)?>+1; i<6;i++){
			document.getElementById('star_'+i).setAttribute('src','<?php echo $src_imag.'_white.png';?>');
		}
	}
}
}
//End code by Hieu Qct 17 2012

function set_rate(value){
jQuery.ajax(
{
	type: 'post',
	url: 'index.php?route=product/product/setrate',
	dataType: 'json',
	data: 'product_id=<?php echo $product_id?>&rate='+value,
	beforeSend: function() {
		},
	success: function(data) {
		}
	
});
}

<!--Start Edit login to rate by Quoc Hieu 01/10/2012 -->
function require_login(){
	var test = confirm('Bạn cần đăng nhập để đánh giá sản phẩm!');
	if (test)
	{
		window.location = "index.php?route=account/login";
	}
}
<!--End Edit login to rate by Quoc Hieu 01/10/2012 -->
<!--Start Edit by Quoc Hieu 02/11/2012 -->
$(document).ready(function(){
	$(".page_shop").hide();
	$(".page_shop:first").show();
	//  When user clicks on tab, this code will be executed
	$(".tabs li").click(function() {
		//  First remove class "active" from currently active tab
		$(".tabs li").removeClass('selected');
 
		//  Now add class "active" to the selected/clicked tab
		$(this).addClass("selected");
 
		//  Hide all tab content
		$(".page_shop").hide();
 
		//  Here we get the href value of the selected tab
		var selected_tab = $(this).find("a").attr("href");
 
		//  Show the selected tab content
		$(selected_tab).fadeIn();
 
		//  At the end, we add return false so that the click on the link is not executed
		return false;
	});
});
<!--End Edit by Quoc Hieu 02/11/2012 -->
</script>